<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Log;
use Illuminate\Http\Request;
use App\Admin_user;
use Illuminate\Support\Facades\Redis;
class LoginController extends Controller
{
    public function login(Request $request)
    {
        session()->forget('account');
        return view('Admin.Login.login',['menu'=>__FUNCTION__]);
    }

    public function do_login(Request $request)
    {
        $account = $request->account;
        $password = $request->password;
        $count = Admin_user::where(['account'=>$account,'password'=>\App\Common::md6($password)])->count();
        if($count){
            $request->session()->put('account',$account);
        }
        return $count;
    }
}
